/// 网络异常统一格式
class OSNetError implements Exception {
  final int code;
  final String message;
  final dynamic data;

  OSNetError(this.code, this.message, {this.data});
}

/// 需要登录
class OSNetErrorNeedLogin extends OSNetError {
  OSNetErrorNeedLogin({int code: 401, String message: "请先登录"})
      : super(code, message);
}

/// 需要授权登录
class OSNetErrorNeedAuth extends OSNetError {
  OSNetErrorNeedAuth(String message, {int code: 403, dynamic data})
      : super(code, message, data: data);
}
